package com.webchat.pay;

import com.webchat.common.util.SpringContextUtil;
import com.webchat.pay.messagequeue.PaymentCallBackRedisDelayQueue;
import com.webchat.pay.service.PaymentCallBackService;
import com.webchat.rmi.annotation.EnableRpcPermissionFilter;
import com.webchat.rmi.annotation.EnableRpcPermissionInterceptor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;

@ComponentScan("com.webchat")
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients("com.webchat.rmi")
@EnableRpcPermissionInterceptor
@EnableRpcPermissionFilter
public class WebchatPayApplication {

    public static void main(String[] args) {

        SpringApplication.run(WebchatPayApplication.class, args);

        SpringContextUtil.getBean(PaymentCallBackRedisDelayQueue.class).schedule();
    }

}
